#include <bits/stdc++.h>
using namespace std;

#define zerol

// using LL = long long;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifdef zerol
#define dbg(x...) do { cout << "\033[32;1m" << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif


//--------------------------------------------------------------------------------------------

// const LL MOD = 1e18+7;
typedef double LL;
const int MAXN = 1e3+5;

// LL bin(LL a, LL b, LL p) {
//     LL res = 1;
//     for (a%=p; b; b>>=1, a=a*a)
//         if (b & 1) res = res * a % p;
//     return res;
// }

// LL inv(LL a, LL p) { return bin(a, p-2, p);}

typedef vector<LL> Poly;

namespace interpolation {
    /*
        integer mod Lagrange interpolation formula
     */
    const int MAXN = 1005;

    // typedef long long LL;
    typedef vector<LL> Poly;

    Poly operator * (const Poly &a, const Poly &b) {
        /*
            O(n^2) Polynomial multiplication method
         */
        Poly c(a.size() + b.size() - 1, 0);
        int an = a.size(), bn = b.size();
        for (int i=0; i<an; ++i)
            for (int j=0; j<bn; ++j)
                c[i+j] = (c[i+j] + a[i]*b[j]);
        while (!c.empty() && c.back() == 0) c.pop_back();
        return c;
    }

    Poly operator + (const Poly &a, const Poly &b) {
        int an = a.size(), bn = b.size(), n = max(an, bn);
        Poly c; c.resize(n);
        for (int i=0; i<n; ++i) {
            c[i] = 0;
            if (i < an) c[i] += a[i];
            if (i < bn) c[i] += b[i];
        }
        while (!c.empty() && c.back() == 0) c.pop_back();
        return c;
    }

    void operator *= (Poly &a, LL b) {
        int n = a.size();
        for (int i=0; i<n; ++i)
            a[i] = a[i] * b;
    }

    Poly g[MAXN];

    LL c[MAXN];

    Poly go(LL x[], LL y[], int n) {
        /*
            make sure x_i is unique
            index start from 0
         */
        for (int i=0; i<n; ++i) {
            LL B = 1;
            g[i] = Poly({1});
            for (int j=0; j<n; ++j) {
                if (i == j) continue;
                B = B * (x[i] - x[j]);
                Poly p = Poly({-x[j], 1});
                g[i] = g[i] * p;
            }
            g[i] *= (y[i]) / B;
        }

        Poly res; res.clear();
        for (int i=0; i<n; ++i) {
            res = res + g[i];
        }
        return res;
    }
}

LL calc(const Poly &p, LL x) {
    LL res = 0;
    int sz = p.size();
    for (int i=sz-1; i>=0; --i) {
        res = (res * x + p[i]);
        // dbg(i, p[i]);
    }
    return res;
}

Poly f = {1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1};


LL x[MAXN], y[MAXN];

// void printPoly(const Poly &p) {
//     int sz = p.size();
//     for (int i=0; i<sz; ++i)
//         printf("%lld ", p[i]);
//     putchar('\n');
// }


int main(int argc, char const *argv[])
{
    LL ans = 0;
    for (int i=1; i<=10; ++i) {
        x[i-1] = i;
        y[i-1] = calc(f, x[i-1]);
        // if (i > 1) {
            Poly c = interpolation::go(x, y, i);
            // printPoly(c);
            LL del = calc(c, i+1);
            ans += del;
        // }
        
    }
    printf("%.0lf\n", ans);

    return 0;
}

